var pId = null;
var eId = null;
var pid = null;
var eid = null;

//科室
$(function(){
	//alert("ppppppppppppp");
	/*pId = $("#pId");
	eId = $("#eId");*/
	$.ajax({
		type:"GET",
		url:"preaddpresident.do",
		dataType:"json",
		success:function(data){
			if(data.key!=null){
				var pid = $("#pid").val();
				$("#pId").html();
				var options = "<option value=\"0\">请选择</option>";
				for(var i=0;i<data.key.length;i++){
					if(pid!=null && pid!= undefined && data.key[i].pId == pid ){
						options +="<option selected=\"selected\" value=\""+data.key[i].pId+"\">"+data.key[i].pName+"</option>"
					}else{
						options += "<option value=\""+data.key[i].pId+"\">"+data.key[i].pName+"</option>";	
					}
				}
				$("#pId").html(options);
			}
		}
		
		
	});
	
	//学历
	$.ajax({
		type:"GET",
		url:"preaddeducation.do",
		dataType:"json",
		success:function(data){
			if(data.key!=null){
				var eid = $("#eid").val();
				$("#eId").html();
				var options = "<option value=\"0\">请选择</option>";
				for(var j=0;j<data.key.length;j++){
					if(eid!=null && eid!= undefined && data.key[j].eId == eid ){
						options += "<option selected=\"selected\" value=\""+data.key[j].eId+"\">"+data.key[j].eName+"</option>";
					}else{
						options += "<option value=\""+data.key[j].eId+"\">"+data.key[j].eName+"</option>";	
					}
				}
				$("#eId").html(options);
			}
		}
	});
});